<template>
	<view class="u-flex-1">
		<u-input inputAlign="right" placeholder="请选择巡检地点" v-model="label" type="select" @click="show=true" />
		<u-picker mode="selector" v-model="show" :default-selector="[0]" :range="locations"
			@confirm="confirm"></u-picker>
	</view>
</template>

<script setup>
	const zoneId = defineModel()
	const show = ref(false)
	const label = ref('')
	
	const props = defineProps({
		locations: {
			type: String,
			default: ''
		}
	})

	const emit = defineEmits(['confirm'])

	function confirm(e) {
		label.value = props.locations[e[0]]
		zoneId.value = props.locations[e[0]]
		emit('confirm')
	}
</script>

<style>

</style>